Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial helper for API keys #13

Merged
merged 18 commits into from
Nov 6, 2020
Merged

Add initial helper for API keys #13

merged 18 commits into from
Nov 6, 2020

Conversation

epenet
Copy link
Collaborator

@epenet epenet commented Nov 1, 2020

Add a RenaultClient with a set of API keys for an initial list of locales, and the ability to fetch the API keys for unknown locales.

@epenet epenet force-pushed the RenaultClient branch 7 times, most recently from 1157840 to 29376bc Compare November 2, 2020 11:54
@epenet
Copy link
Collaborator Author

epenet commented Nov 2, 2020

@oncleben31 / @Quentame
Comment puis-je résoudre le problème avec typeguard?

@epenet epenet force-pushed the RenaultClient branch 6 times, most recently from e4e26f0 to 4be639a Compare November 2, 2020 16:27
@epenet epenet marked this pull request as ready for review November 2, 2020 16:43
@epenet
Copy link
Collaborator Author

epenet commented Nov 2, 2020

Après avoir bien galéré sur les dépendances (en particulier autour de typeguard qui n'aimait pas mon fichier conftest.py pour les fixtures.) je crois que c'est bon pour un avis externe.

@epenet epenet changed the title Draft: add Renault client Add initial Renault client Nov 2, 2020
src/renault_api/const.py Outdated Show resolved Hide resolved
src/renault_api/const.py Outdated Show resolved Hide resolved
src/renault_api/client.py Outdated Show resolved Hide resolved
src/renault_api/client.py Outdated Show resolved Hide resolved
src/renault_api/client.py Outdated Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
pyproject.toml Outdated
@@ -21,6 +21,8 @@ Changelog = "https://github.com/hacf-fr/renault-api/releases"
[tool.poetry.dependencies]
python = "^3.7.1"
click = "^7.0"
aiohttp = "^3.7.2"
typing-extensions = "^3.7.4"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see where you use typing-extension. is it necessary here ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a dependency of aiohttp, and it was causing issues with mypy.
It seems to be sufficient inside dev dependencies to I will move it there now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange sub dependencies should be managed installed by poetry. I will investigate. Can you confirm the version of poetry you have installed ?

Copy link
Collaborator Author

@epenet epenet Nov 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Poetry version 1.1.4 on my machine, but the problems occured inside CI runs

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Poetry version 1.1.x is new and has regression on export features (see python-poetry/poetry#3189).

When you use it locally poetry generate bad dependencies resolution in the poetry.lock file. This file is commited in git and reuse by the CI whatever poetry version we have pinned in the CI. So this could lead to strange results.

Do you mind trying to install locally poetry 1.0.10, remove the typing-extensions in pyproject.toml run the command poetry lock and check if you still have the issue with mypy ?

noxfile.py Outdated Show resolved Hide resolved
@epenet
Copy link
Collaborator Author

epenet commented Nov 4, 2020

I have moved the api-keys to a helper module (not inside the Renault client)
I think now it's just the dependencies for mypy/test/typeguard that need to be checked.

@epenet epenet changed the title Add initial Renault client Add initial helper for API keys Nov 4, 2020
@epenet
Copy link
Collaborator Author

epenet commented Nov 4, 2020

@oncleben31 I think the dependency issue is fixed. Can you please recheck?

@oncleben31
Copy link
Member

Good job. Dependencies seems OK.

@epenet
Copy link
Collaborator Author

epenet commented Nov 4, 2020

@Quentame any last comment before I merge this initial commit?

tests/test_api_keys.py Outdated Show resolved Hide resolved
Copy link
Member

@Quentame Quentame left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment, otherwise LGMT.

Can be merge after comment.

@epenet epenet merged commit c843174 into main Nov 6, 2020
@epenet epenet deleted the RenaultClient branch November 6, 2020 09:12
@epenet
Copy link
Collaborator Author

epenet commented Nov 6, 2020

Thanks @Quentame / @oncleben31

@oncleben31 oncleben31 added the enhancement New feature or request label Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants